<template>
	<view>
		
		<!-- 小程序顶部样式 -->
		<cu-custom bgColor="bg-blue" :isBack="false">
			<!-- <block slot="content">公司详情</block> -->
		</cu-custom>
		
		<scroll-view scroll-x class="bg-blue nav text-center">
			<view class="flex align-center justify-around">
				<view class="cu-item" :class="0==TabCur?'text-white cur':''" @tap="tabSelect" data-id="0">
					<text class="cuIcon-list"></text> 详情
				</view>
				<view class="cu-item" :class="1==TabCur?'text-white cur':''" @tap="tabSelect" data-id="1">
					<text class="cuIcon-upstagefill"></text> 点评
				</view>
				<view class="cu-item" :class="2==TabCur?'text-white cur':''" @tap="tabSelect" data-id="2">
					<text class="cuIcon-clothesfill"></text> 面试
				</view>
				<view class="cu-item" :class="3==TabCur?'text-white cur':''" @tap="tabSelect" data-id="3">
					<text class="cuIcon-pay"></text> 工资
				</view>
			</view>
		</scroll-view>
		
		<interview v-if="TabCur == 2" :companyId="companyId"></interview>
		<remark v-else-if="TabCur == 1" :companyId="companyId"></remark>
		<wage v-else-if="TabCur == 3" :companyId="companyId"></wage>
		
	</view>
</template>

<script>
	
	import wage from './components/wage.vue'
	import interview from './components/interview.vue'
	import remark from './components/remark.vue'
	
	export default {
		components: {
			wage,
			remark,
			interview
		},
		data() {
			return {
				TabCur: 1,
				companyId: ''
			}
		},
		onLoad(option) {
			if(option.tab){
				this.TabCur = option.tab
			}
			this.companyId = option.companyId
		},
		methods: {
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
				if(this.TabCur == 0){
					uni.navigateBack({
						delta: 1
					})
				}
			}
		}
	}
</script>

<style>

</style>
